package com.feeyo.groundservice.composewidget.util

import androidx.annotation.StringRes
import androidx.compose.runtime.Composable
import androidx.compose.runtime.Stable
import androidx.compose.ui.res.stringResource

/**
 *作者：QLH on 2023-08-01
 *描述：  compose的工具类：字符串转换
 */

/**
 * 将stringRes值转换为String，和kotlin的getString()扩展底层一样
 * @return String 值
 */
@Stable
@Composable
fun @receiver:StringRes Int.toComposeString(): String = stringResource(this)

/**
 * 将stringRes值转换为String
 * @return String 值
 */
@Stable
@Composable
fun @receiver:StringRes Int.toComposeStringWithParams(vararg params:Any): String =
    stringResource(this, *params)